package com.airnewslinkosky.ticket.ui.financial;

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.airnewslinkosky.ticket.R;
import com.airnewslinkosky.ticket.ui.BaseActivity;
import com.mobclick.android.MobclickAgent;

public class FinancialDetail   extends BaseActivity implements OnClickListener{
	private ProgressDialog progressDialog = null;
	
	private LinearLayout orderinfoLayout,sale_countLayout,pay_infoLayout;
	private boolean orderExpand = false;
	private boolean saleExpand = false;
	private boolean payExpand = false;
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.financial_detail);
		// 删除窗口背景
        getWindow().setBackgroundDrawable(null);
        
		activityList.add(this);
		
		
		findViewById(R.id.backBut).setOnClickListener(this);
		
		orderinfoLayout = (LinearLayout) findViewById(R.id.orderinfo2_layout);
		sale_countLayout = (LinearLayout) findViewById(R.id.sale_count2_layout);
		pay_infoLayout = (LinearLayout) findViewById(R.id.pay_info2_layout);
		
		orderinfoLayout.setOnClickListener(this);
		sale_countLayout.setOnClickListener(this);
		pay_infoLayout.setOnClickListener(this);
		
		
	}
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
			case R.id.backBut: 
				Intent intentR = new Intent();
				intentR.setClass(FinancialDetail.this, FinancialList.class);
				startActivity(intentR);
				break;
			case R.id.orderinfo2_layout: 
				if(orderExpand){
					findViewById(R.id.orderinfo_layout).setVisibility(View.GONE);
					orderExpand = false;
				} else {
					findViewById(R.id.orderinfo_layout).setVisibility(View.VISIBLE);
					orderExpand = true;
				}
				break;
			case R.id.sale_count2_layout: 
				if(saleExpand){
					findViewById(R.id.sale_count_layout).setVisibility(View.GONE);
					saleExpand = false;
				} else {
					findViewById(R.id.sale_count_layout).setVisibility(View.VISIBLE);
					saleExpand = true;
				}
				break;
			case R.id.pay_info2_layout: 
				if(payExpand){
					findViewById(R.id.pay_info_layout).setVisibility(View.GONE);
					payExpand = false;
				} else {
					findViewById(R.id.pay_info_layout).setVisibility(View.VISIBLE);
					payExpand = true;
				}
				break;
		}
	}
	
	public void onResume() {     
		super.onResume();     
		MobclickAgent.onResume(this); 
	}  
	
	public void onPause() {     
		super.onPause();     
		MobclickAgent.onPause(this); 
	}  
}
